package com.wenwan.manage.pojo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

@JsonInclude(Include.NON_NULL)
public class ReportArticle implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -344945634285872140L;

	private String id;

	private Double price;
	@JsonIgnore
	private String contentJson;

	private List<Content> content = new ArrayList<Content>();

	private String belong;

	private String title;

	public ReportArticle() {
		// TODO Auto-generated constructor stub
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getContentJson() {
		return contentJson;
	}

	public void setContentJson(String contentJson) {
		this.contentJson = contentJson;
	}

	public List<Content> getContent() {
		if (contentJson != null) {
			content = new Gson().fromJson(contentJson, new TypeToken<List<Content>>() {
			}.getType());
		} else {
			content = null;
		}
		return content;
	}

	public void setContent(List<Content> content) {
		this.content = content;
	}

	public String getBelong() {
		return belong;
	}

	public void setBelong(String belong) {
		this.belong = belong;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}
